﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DEMOweek2
{
    public partial class Form1 : Form
    {
        Day day1;


        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int day, month, year;
     /*     day = Convert.ToInt32(tbDay.Text);
            month = Convert.ToInt32(tbMonth.Text); 
            year= Convert.ToInt32(tbYear.Text);*/

            day = dateTimePicker1.Value.Day;
            month = dateTimePicker1.Value.Month;
            year = dateTimePicker1.Value.Year;


            day1 = new Day( day,month,year    );
       //     MessageBox.Show("Date is: " + day1.DayNr + "-" + day1.MonthNr + "-" + day1.Year);
            listBox1.Items.Add("Date is: " + day1.DayNr + "-" + day1.MonthNr + "-" + day1.Year);
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            MessageBox.Show(""+listBox1.SelectedItem);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int count = (int)numericUpDown1.Value;
         //   int count = Convert.ToInt32(comboBox1.SelectedItem.ToString());
           
            for (int i = 0; i < count; i++)
            {
                day1.Move1DayForward();
                listBox1.Items.Add("Date is: " + day1.DayNr + "-" + day1.MonthNr + "-" + day1.Year);
                
            }
        }
    }
}
